package com.chaos.generator.config;

public interface GeneratorConfig {

    Project project = Project.TURING;
    String tables = "t_user_follow,t_user_activity";


    String author = "jacky";
    String projectPackageName = "com.chaos";
    String projectPackagePath = getProjectRootPath() + "src/main/java/";
    String projectMapperPath = getProjectRootPath() + "src/main/resources/mapper/";

    String rootPath = projectPackageName + "." + project.name;
    String ignorePrefix = "t_";

    static String getProjectRootPath() {
        return project.projectRootPath;
    }

    enum Project {
        SYSTEM("system", "/Users/cuijian/Documents/GitHub/chaos/chaos-service/chaos-system/chaos-system-service/",
                "chaos"),
        TURING("turing", "/Users/cuijian/Documents/GitHub/turing/turing-service/chaos-turing-service/", "turing");

        private final String name;
        private final String projectRootPath;
        private final String db;

        public String getName() {
            return name;
        }

        public String getDB() {
            return db;
        }

        Project(String name, String projectRootPath, String db) {
            this.name = name;
            this.projectRootPath = projectRootPath;
            this.db = db;
        }

        Project fromName(String name) {
            for (Project project : Project.values()) {
                if (project.name.equals(name)) {
                    return project;
                }
            }
            return null;
        }


    }

}
